from typing import List


class Solution:
    def threeSum(self, nums: List[int]) -> List[List[int]]:
        results = []
        num_length = len(nums)

        for i in range(0, num_length):
            for j in range(i+1, num_length):
                for k in range(j + 1, num_length):
                    if nums[i] + nums[j] + nums[k] == 0:
                        l = sorted([nums[i], nums[j], nums[k]])
                        if l not in results:
                            results.append(l)
        return results


if __name__ == "__main__":
    nums = [-1, 0, 1, 2, -1, -4,5,-5,1,0,5,9]
    result = Solution().threeSum(nums)
    print(result)
